<template>
  <div>
    <input type="text" v-Focus v-model="count" placeholder="请输入" />
  </div>
</template>

<script setup>
import { ref, nextTick } from "vue";
const count = ref("");
// 必须遵循 vNameOfDirective 这样的命名规范：
const vFocus = {
  inserted(el) {
    console.log(el);
    nextTick(() => {
      el.focus();
    });
  },
};
</script>

<style scoped>
button {
  padding: 20px 20px;
  background-color: pink;
}
</style>
